Conversation
|
@robproject This will require tests, let me know if you want some suggestions about it. |
|
Yes, I was thinking verifying HU is preserved or not based on those three SE types and the setting would satisfy the requirement, should there be others? |
|
In a case where anything less than the full amount is transferred you end up with new HUs, which I think makes the most sense. I would want this to be under test as well. |
|
if the HUs have any change in qty, would it be a repack or non-transfer SE type? |
|
Any type of transfer should follow this rule. |
|
Since the preservation is confined to those three SE types, it can have an additional condition added for preservation that verifies the HU is the complete qty. What if it 1. fetched the SLE for adding that qty comparison to the condition for preservation, or 2. fetched it to compare qty and throw an error in validate_items_with_handling_unit ? |
| handling_unit = frappe.new_doc("Handling Unit") | ||
| handling_unit.save() | ||
| row.to_handling_unit = handling_unit.name | ||
| else: |
There was a problem hiding this comment.
This should include a condition where the stock quantities are equal. If you are splitting a HU into two pieces, they cannot have the same number.
|
Would the second action of xfer remaining 5Eac be equal to an xfer of that HU? Scanning after the xfer of 15Eac would mean that HU would populate as 5Eac? |
Potentially, yes. The "and its packaging " part of the definition of Handling Unit complicates this. A "Sack of Flour" item - sure, the sack and remaining flour are consumed. If it's a six-pack of Corona Light, I think there's an argument that you discard the paper holder at some point. This might be an argument for configuring "always split" at the item level as well as a global fallback.
That's how net quantities should behave, yes. But this currently doesn't preserve the HU of those final five items into the new location. I am inclined to think that it should not. |
Update branch with hooks extension js fix.
4ba2c8c to
d7c4a05
Compare
for Mat xfer and Send to Sub
|
Inventory dimension preservation, including HU, can be configured in a separate app |
Description
Adds setting to allow preservation of complete Handling Units for those transactions where they are complete quantities.
(mat xfer, Send to Subcontractor,
mat xfer for mfg)Existing behavior with generation for every transaction is default (unchecked) for this setting.
Modifies get_handling_unit method since Handling Units are no longer implicitly grouped by Warehouse due to being shared via full qty transfers, the query was rewritten to include the Warehouse groupby. The newest created SLE is returned (this needs to be ordered by posting date as well) for a warehouse with a qty, since there will only ever be one warehouse with any qty for a HU.
Testing
Observe HU is preserved between source and target in the above cases when 'Always Generate for Transfer' is unchecked in BEAM Settings.
note: pytest was not created